package feeinterface.dao;

import java.util.HashMap;
import java.util.Map;

import org.apache.log4j.Logger;

import com.ulwx.tool.CTime;
import com.ulwx.tool.DbUtils;

/**
 * 通道周期记录表
 * 
 * @author 黄杰
 * 
 */
public class ChannelCycleDao {
	
	private static final Logger log = Logger
			.getLogger(ChannelCycleDao.class);
	/**
	 * 更新计费金额,次数
	 * 
	 * @param channelID
	 * @param Fee
	 * @throws Exception
	 */
	public static void updateCnt(Integer channelID, Integer Fee,
			Integer settleFee)
			{
		try{
		String sql = "update ChannelCycle set CurDayFee=CurDayFee+?," +
				"CurMonthFee=CurMonthFee+?," +
				"CurHourFee=CurHourFee+?,CurMonthSettleFee=CurMonthSettleFee+? " +
				"where  ChannelID =?";
		Map<Integer, Object> map = new HashMap<Integer, Object>();
		
		map.put(1, Fee);
		map.put(2, Fee);
		map.put(3, Fee);
		map.put(4, settleFee);
		map.put(5, channelID);
		DbUtils.executeBindUpdate(null, sql, map);
		}catch(Exception e){
			log.error("",e);
		}
		return;
	}
	public static void main(String[] args) {
		updateCnt(10025,100,40);
	}

}
